<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCheckTeachersTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('check_teachers', function (Blueprint $table) {
//            $table->comment('学年考核老师表');
            $table->increments('id');
            $table->integer('check_id')->index('check_id_index');
            $table->integer('user_id')->index('user_id_index');
            $table->string('username', 25)->default('');
            $table->boolean('status')->default(true)->comment('状态 0-删除 1-正常');
            $table->boolean('title_level')->default(false)->comment('教师职称等级');
            $table->string('title_name', 50)->default('')->comment('教师职称名称');
            $table->float('scores', 5)->comment('总分');
            $table->float('average_score', 5)->comment('平均分');
            $table->boolean('check_status')->default(false)->comment('审核状态 0-未参与审核 1-已参与审核');
            $table->integer('sort')->default(1)->index('sort_index')->comment('排序');
            $table->boolean('is_check')->default(false)->comment('是否全部评分完成 0-否 1-是');
            $table->dateTime('check_time')->nullable()->comment('审核完成时间');
            $table->integer('check_sums')->default(0)->comment('当前审核人数');
            $table->timestamp('created_at')->nullable()->useCurrent();
            $table->timestamp('updated_at')->useCurrentOnUpdate()->nullable()->useCurrent();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('check_teachers');
    }
};
